package com.sloera.factory;

import java.lang.reflect.Proxy;

public class ProxyFactory {
    public static <T> T getServiceByClass(Class<T> clazz) {
        return (T) Proxy.newProxyInstance(ProxyFactory.class.getClassLoader(),
                new Class[]{
                        clazz
                }, new RPCInvocationHandler());
    }
}
